import { createRouter, createWebHistory } from 'vue-router'
import { routes } from './routes'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: routes,
  // 切换路由时，滚动条回到顶部
  scrollBehavior() {
    return {
      top: 0
    }
  }
})

export default router
